package se.webbzon.boltzmann.game.event;

import se.webbzon.boltzmann.effect.CharacterSpinningEffect;
import se.webbzon.boltzmann.effect.Effect;
import se.webbzon.boltzmann.game.character.AbstractCharacter;
import se.webbzon.boltzmann.game.sequence.Sequence;
import se.webbzon.oschi01.worldarea.WorldArea;
import se.webbzon.oschi01.worldobject.WorldObject;

public class SpinToEvent extends JumpToEvent {
	
	/*============================================================
	Constructors
	============================================================*/

	public SpinToEvent(Sequence sequence, WorldObject binding, String[] arguments) {
		super(sequence, binding, arguments);
	}
	
	/*============================================================
	Public Methods
	============================================================*/
	
	@Override protected void onBegin(WorldArea world) {
		super.onBegin(world);
		WorldObject binding = getBinding();
		if (binding instanceof AbstractCharacter) {
			AbstractCharacter character = (AbstractCharacter) binding;
			Effect e = new CharacterSpinningEffect(character,20,2);
			e.launch(world);
		}
	}

}
